#include "al_game_pch.h"

#include "common.c"

int main(int argc, char *argv[]) {
	ALLEGRO_DISPLAY *display;

	if (!al_init()) {
		abort_example("Error initialising Allegro.\n");
		return 1;
	}
	al_install_keyboard();
	display = al_create_display(640, 480);
	if (!display) {
		abort_example("Unable to create display.\n");
		return 1;
	}

	ALLEGRO_KEYBOARD_STATE state;
	double start = al_get_time();
	double start_secs = al_get_time();
	long frames = 0;
	do {
		al_flip_display();
		al_get_keyboard_state(&state);
		start = al_get_time();
	} while (!al_key_down(&state, ALLEGRO_KEY_ESCAPE));

	double elapsed = al_get_time() - start_secs;
	printf("%g fps\n", frames/elapsed);

	return 0;
}

